package com.aiju.cash.core.api;

import com.aiju.app.config.ConfigManager;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.StringCallback;

/**
 * @author: 佐为
 * @date: 2017-01-04 14:29
 * @version: V1.0
 * @Description: 收入
 */
public class RevenueApi {

    private String list = ConfigManager.INIT_SERVER_HOST + "/income/list";
    private String listByType = ConfigManager.INIT_SERVER_HOST + "/income/listByType";
    private String refundList = ConfigManager.INIT_SERVER_HOST + "/income/refundList";

    /**
     * shour
     *
     * @param token    令牌
     * @param callback
     */
    public void list(String token, String storeId, StringCallback callback) {
        OkHttpUtils
                .post()
                .url(list)
                .addParams("storeId", storeId)
                .addParams("token", token)
                .build()
                .execute(callback);
    }


    /**
     * 流水列表
     *
     * @param token    令牌
     * @param callback
     */
    public void listByType(String token, String storeId, String type, String currentNum, String pageSize, StringCallback callback) {
        OkHttpUtils
                .post()
                .url(listByType)
                .addParams("storeId", storeId)
                .addParams("token", token)
                .addParams("type", type)
                .addParams("currentNum", currentNum)
                .addParams("pageSize", pageSize)
                .build()
                .execute(callback);
    }

    /**
     * 退款
     *
     * @param token    令牌
     * @param callback
     */
    public void refundList(String token, String storeId, String currentNum, String pageSize, StringCallback callback) {
        OkHttpUtils
                .post()
                .url(refundList)
                .addParams("token", token)
                .addParams("storeId", storeId)
                .addParams("currentNum", currentNum)
                .addParams("pageSize", pageSize)
                .build()
                .execute(callback);
    }
}
